<?php
namespace App\Scopes\Orders;

use Hyperf\Database\Model\Builder;
use Hyperf\Database\Model\Model;
use Hyperf\Database\Model\Scope;

/**
 * Class Good Scope
 * @author zx
 * @package App\Scopes\Goods
 */
Class OrderAction implements Scope {

    public function apply(Builder $builder, Model $model)
    {
        $app = getApp();
        switch ($app) {
            case 'api':
                $builder->where('shop_id', getShop('id'));
                break;
        }
    }

}